package www.openteam.com.presenter.prdctnMngmnt;

import java.util.HashMap;

import www.openteam.com.base.BasePresenter;
import www.openteam.com.bean.SendRcvBean;
import www.openteam.com.contract.PrdctnMngmnt.SendRcv;
import www.openteam.com.contract.business.QryCstChildInfoContract;
import www.openteam.com.model.PrdctnMngmnt.SendRcvModel;
import www.openteam.com.mvp.IModel;
import www.openteam.com.ui.prdctnMngmnt.SendRcvFragment;

/**
 * Created by OT on 2017-10-20.
 */

public class SendRcvPresenter extends BasePresenter<SendRcvFragment>
        implements SendRcv.MPressenter{




    @Override
    public void getDataSuccess(String stype,String rdsno) {
        ((SendRcvModel)getiModelMap().get("SendRcvPresenter")).
                getSendRcvData(stype, rdsno, new SendRcvModel.SendDataListener() {
                    @Override
                    public void success(SendRcvBean sendRcvBean) {
//                        sendRcvBean.getData().getData().get(0).setProcno("OpenTeam");
//                        sendRcvBean.getData().getData().get(1).setProcno("OpenTeam");
//                        sendRcvBean.getData().getData().get(2).setProcno("OpenTeam");
                        getIView().success(sendRcvBean);
                    }

                    @Override
                    public void fail(Throwable e) {
                        getIView().fail(e);
                    }
                });
    }

    @Override
    public HashMap<String, IModel> getiModelMap() {
        return loadModelMap(new SendRcvModel()) ;
    }

    @Override
    public HashMap<String, IModel> loadModelMap(IModel... models) {
        HashMap<String, IModel> hashMap = new HashMap<>();
        hashMap.put("SendRcvPresenter", models[0]);
        return hashMap;
    }
}
